import { Entity, PrimaryGeneratedColumn, Column , CreateDateColumn, JoinColumn, ManyToOne} from 'typeorm';
import { User } from "../users/user.entity"

@Entity('report')
export class Report {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  userId: number | string;

  @Column()
  reportType: string;

  @Column()
  reportContent: string;

  @Column()
  publish_id: string;

  @CreateDateColumn({ type: 'timestamp' })
  reportTime: Date;

  @Column({ nullable: true })
  otherDescription: string;

  @ManyToOne(() => User)
  @JoinColumn({ name: 'userId' }) // 在数据库中关联的字段名
  user: User;
  
}
